<?php
    $attach = new Attach();
    $curnavarr = $manage->querymid($mid);
?>

<form action="<?php echo Fun::curcul(); ?> " method="post" class="aform">
    <h2 class="formdesc">

        <?php
        $manaarr=$manage->querymid($mid);
        printf('修改 %s 目录',$manaarr[0]['cat_name']);
        ?>

    </h2>
    <?php echo ($actinfo);?>

    <div class="line">
        <label class="labe">ID</label>
        <input class="inpt1" type="text" disabled="disabled" value="<?php echo $curnavarr[0]['id']?>">
    </div>
    <div class="line">
        <label class="labe">目录名称</label>
        <input class="inpt1" type="text" name="cname" value="<?php echo $curnavarr[0]['cat_name']?>">
        <span class="must">*</span>
    </div>
    <div class="line">
        <label class="labe">模板类型</label>
        <select class="inpt1" name="ctpl">
            <?php
            foreach ($table->select() as $val) {
                printf('<option value="%s" %s>%s</option>',
                    $val['id'],
                    $curnavarr[0]['cat_tpl_id'] === $val['id'] ? 'selected=selected' : '',
                    $val['table_desc']
                );
            }
            ?>

        </select>
    </div>
    <div class="line">
        <label class="labe">列表文件</label>
        <input class="inpt1" type="text" name="lfile" value="<?php echo $curnavarr[0]['list_flie']?>">
    </div>
    <div class="line">
        <label class="labe">列表模板</label>
        <input class="inpt1" type="text" name="ltpl" value="<?php echo $curnavarr[0]['list_tpl']?>">
    </div>
    <div class="line">
        <label class="labe">文件模板</label>
        <input class="inpt1" type="text" name="ftpl" value="<?php echo $curnavarr[0]['file_tpl']?>">
    </div>
    <div class="line">
        <label class="labe">命名规则</label>
        <input class="inpt1" type="text" name="nrule" value="<?php echo $curnavarr[0]['name_rule']?>">
    </div>
    <div class="line">
        <label class="labe">分页</label>
        <input class="inpt1" type="text" name="pnum" value="<?php echo $curnavarr[0]['page_num']?>">
    </div>
    <div class="line">
        <label class="labe">上传路径</label>
        <input class="inpt1" type="text" name="fpath" value="<?php echo $curnavarr[0]['file_path']?>">
    </div>

    <div class="line subline"><input class="sub" type="submit" value="修改目录"></div>
</form>
<div class="man_atch">
    <h3>使用附带发布</h3>
    <ul class="man_atch">
    <?php

    foreach ($attach->select() as $v) {
       printf('<li> <strong>%s</strong>   %s </li> ',
                $v['name'],
                in_array( $v['id'],explode(',',$curnavarr[0]['attach_id']))?
                    '<span><a href="editmanage.php?act=atch&apact=del&mid='.$mid.'&aid=' . $v['id'].'">取消</a></span>':
                    '<span><a href="editmanage.php?act=atch&mid='.$mid.'&aid=' . $v['id'].'">使用</a></span>'

               );
    }
    ?>
    </ul>
</div>
<div class="man_filedshow">
    <h3>显示字段</h3>
    <ul>
    <?php
        foreach ($manage->getallfiled($mid) as $val) {
            printf('<li><strong>%s</strong>  %s</li> ',
                $val['filed_desc'],

                in_array( $val['id'],explode(',',$curnavarr[0]['showfiledid']))?
                    '<a href="editmanage.php?act=showfiled&apact=del&mid='.$mid.'&fid=' . $val['id'].'">不显示</a>':
                    '<a href="editmanage.php?act=showfiled&mid='.$mid.'&fid=' . $val['id'].'">显示</a>'
            );
        }

        ?>
    </ul>

</div>

